import { withState } from "../context";

import React, { useCallback } from "react";

const Title = (props) => {
    const { state, dispatch } = props;
    const { title } = state;
    const handleClick = useCallback(() => {
        dispatch({ type: "IncreaseTitle" });
    })
    return <div onClick={handleClick}>{title}</div>
}

export default withState(Title);